import java.util.ArrayList;

/**
 * Abstract class for objects that represent areas of the Sukodu grid.
 * Made abstract because a GridArea object should never be instantiated
 * even though the methods are concrete.
 * @author Kat.Winter
 */
public abstract class GridArea {
	
	/**
	 * Represents numbers present in this area of the grid
	 */
	private ArrayList<Integer> values = new ArrayList<Integer>();
	
	/**
	 * Adds a number to the values held in this area of the grid
	 * @param val  Value to be added
	 */
    public void addValue(int val) {
		
		values.add(new Integer(val));
	}
    
    /**
     * Removes a number from the values held in this area of the grid
     * @param val  Value to be removed
     */
    public void remValue(int val) {
    	
    	values.remove(new Integer(val));
    }
    
    /**
     * Checks to see if a number is present in this area of the grid
     * @param val  Number to check for
     * @return  True or False that the number was found
     */
    public boolean isPresent(int val) {
		
		for (Integer value: values) {
			
			if (value == val) {
				
				return true;
			}
		}
		
		return false;
	}
}
